doors metrics OR statement

hi,

i have a nice little metrics script thingy that runs through a configurable list of modules and pulls out various metrics.

...........................................................................

of Reqs: attribute "IE Object Type" == "Requirement"
of Info: attribute "IE Object Type" == "Information"

of Reqs linked: attribute "IE Object Type" == "Requirement"  && hasLinks(linkFilterOutgoing, "*")

of Reqslinked and derived: attribute "IE Object Type" == "Requirement"  && hasLinks(linkFilterOutgoing, "*") &&  attribute "IE Object Type" == "Requirement"  && attribute "Justification" == "Derived Requirement"

of Orphans: attribute "IE Object Type" == "Requirement"  && hasNoLinks(linkFilterOutgoing, "*")

of Derived : attribute "IE Object Type" == "Requirement"  && attribute "Justification" == "Derived Requirement"

i have a tricky little number that i need pulled out but i dont know how to do it in dxl code so perhaps someone can help?!

in the above example it does "of reqts linked" and "of reqts derived" - what i would like to be able to pull out is the number of reqts then add on an OR statement so "hasLinks(linkFilterOutgoing, "*") OR attribute "Justification" == "Derived Requirement") in simple terms - i can get it working with AND but i really want OR!

would appreciate your help as i have tried to look through dxl books but nothing is working!

thanks in advance


doorsuser77 - Wed May 29 12:43:55 EDT 2013

Re: doors metrics OR statement
llandale - Wed May 29 13:41:22 EDT 2013

I do not recognize your syntax

  • of Reqs: attribute "IE Object Type" == "Requirement"

Huh?

But let me answer your question.  Use parenthesis.

 I don't use "&&" nor "||", I always use the corresponding "and" and "or".  I think you are asking to turn:

  • if (A and B) then

into

  • if (A and (B or C)) then

or in your real world terms:

  • if (obj."IE Object Type" "" == "Requrirement                             and
  •      ( hasLinks(linkFilterOutgoing, "*")                 or
  •         obj."Justification" "" == "Derived Requirement")) then

By indenting "and" out and "or" in we get a sense of the order of precedence.

-Louie